package cn.edu.cqut.mdm.web;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import cn.edu.cqut.mdm.core.moduleproxy.ModuleProxy;
import cn.edu.cqut.mdm.test.moduleproxy.IModule1;

@Controller
@RequestMapping("/demo")
public class DemoController {
	@ModuleProxy
	private IModule1 module1;
	
	@RequestMapping("/index")
	public String index() {
		return "demo";
	}
	
	@RequestMapping("/encode")
	@ResponseBody
	public String encode(String str) {
		return module1.encode(str);
	}
	
	@RequestMapping("/decode")
	@ResponseBody
	public String decode(String str) {
		return module1.decode(str);
	}

	public void setModule1(IModule1 module1) {
		this.module1 = module1;
	}
}